<template>
    <div>
        <div class="left">
            <p><img :src="'/ele/'+personner.goodsPic" alt="">  </p>
            <div>照片</div>
        </div>
        <div class="right">
            <div>详细信息</div>
            <div>
                <p>姓名: {{personner.goodsName}}</p>
                <p>工资: {{personner.goodsPrice}}</p>
                <p>职位: {{personner.goodsTypeName}}</p>
                <p>所在部门: {{personner.shopTypeName}}部</p>
                <p>所在组: {{personner.shopName}}组</p>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            personner:{}
        }
    },
   async mounted(){
       await this.$store.dispatch("getGoodsList")
        // console.log(this.$store.state.goods.goodsList)
        // for (x in this.$store.state.goods.goodsList){
        //     console.log(this.$store.state.goods.goodsList[x])
        // }
        // 
        this.$store.state.goods.goodsList.map(v=>{
            // console.log(v)
            if(v.goodsName===localStorage.adminName){
                // console.log(v)
                this.personner=v
            }
        })
        // console.log(this.personner)
    }
}
</script>

<style lang="less" scoped>
    .left{
        float: left;
        p{
            width: 250px;
            height: 300px;
            border: 3px solid #ccc;
            box-shadow:5px 5px 10px 5px;
            padding: 5px;
            margin-bottom: 15px;
            img{
                width: 100%;
                height: 100%;
            }
        }
        margin: 0 30px 0 0;
        div{
            text-align: center;
        }
    }
    .right{
        p{
            margin-top: 20px;
            font-size: 28px;
        }
    }
</style>
